<template>
	<view class="assist">
		<view class="listItem" v-for="(item,index) in props.list" :key="index">
			<view class="top">
				<view class="left">
					<image :src="data.httpUrl+'/app/file/viewFile?fileId='+item.publishUserAvatarId" mode="aspectFill">
					</image>
					<text class="ellipsis_1">{{item.publishUserName}}</text>
				</view>
				<view class="right">
					<view class="">
						发起了一笔
						<text>{{item.freeAmount}}</text>
						元免单互动
					</view>
					<text>备注:{{item.remark}}</text>
				</view>
			</view>
			<view class="top_1">
				<view class="left" @tap="emit('share',item)">
					{{props.num == 1?'立即分享':props.num == 2?'立即参与':''}}
				</view>
				<view class="right">
					<view class="item" v-for="(item1,index1) in item.inviteUsers"  :key="index1">
						<image v-if="item1.userAvatarId" :src="data.httpUrl+'/app/file/viewFile?fileId='+item1.userAvatarId" mode="aspectFill">
						</image>
						{{!item1.userAvatarId?'?':''}}
						<text :class="item1.userAvatarId?'active':''">{{item1.percent}}</text>
					</view>
				</view>
			</view>
			<view class="bot">
				活动倒计时
				<view></view>
				<text>{{item.countDownTime}}</text>
			</view>
		</view>
	</view>
</template>

<script setup lang="ts">
	import { reactive } from 'vue'
	const emit = defineEmits(['share'])
	const props = defineProps(['list','num'])
	const data = reactive({
		httpUrl: getApp().globalData.baseUrl,
	
	})
</script>

<style lang="scss">
	.assist {
		>view:nth-of-type(1) {
			margin-top: 0;
		}

		.listItem {
			margin-top: 20rpx;
			padding: 20rpx;
			border-radius: 24rpx;
			background: #fff;

			>.top {
				display: flex;
				align-items: flex-start;

				.left {
					position: relative;
					width: 120rpx;
					height: 120rpx;
					border-radius: 50%;
					border: 2rpx solid #FF263F;
					margin-right: 32rpx;

					image {
						width: 100%;
						height: 100%;
						border-radius: 50%;
					}

					text {
						width: 102rpx;
						line-height: 44rpx;
						text-align: center;
						background: #FF263F;
						border-radius: 8rpx;
						font-size: 24rpx;
						color: #fff;
						position: absolute;
						left: 50%;
						bottom: -8rpx;
						margin-left: -51rpx;
					}
				}

				.right {
					flex: 1;

					view {
						font-size: 32rpx;
						margin-bottom: 12rpx;

						text {
							font-size: 32rpx;
							color: #FF263F;
						}
					}

					>text {
						color: #8C8C8C;
					}
				}
			}

			>.top_1 {
				display: flex;
				align-items: flex-end;

				.left {
					width: 125rpx;
					line-height: 44rpx;
					text-align: center;
					border-radius: 22rpx;
					background: linear-gradient(233deg, #FFA34B 0%, #FF8E6F 100%);
					color: #fff;
					font-size: 24rpx;
					margin-right: 27rpx;
				}

				.right {
					display: flex;
					flex: 1;
					flex-wrap: wrap;

					view {
						width: 96rpx;
						height: 96rpx;
						border-radius: 50%;
						border: 2rpx dashed #F0F0F0;
						display: flex;
						align-items: center;
						margin-right: 3rpx;
						justify-content: center;
						color: #8C8C8C;
						font-size: 29rpx;
						font-weight: bold;
						position: relative;
						image{
							width: 100%;
							height: 100%;
							border-radius: 50%;
						}
						text {
							position: absolute;
							right: 0;
							bottom: 0;
							width: 63rpx;
							line-height: 44rpx;
							text-align: center;
							display: inline-block;
							border-radius: 8rpx;
							background: #F4F6FA;
							color: #BFBFBF;
						
							font-size: 24rpx;
							font-weight: bold;
						}
						.active{
							background: #EDFCD2;
							color: #6AC922;
						}
					}

					>view:last-child {
						margin-right: 0;
					}
				}
			}

			.bot {
				padding-top: 16rpx;
				margin-top: 16rpx;
				border-top: 2rpx solid #F4F6FA;
				display: flex;
				align-items: center;
				color: #8C8C8C;

				view {
					width: 2rpx;
					height: 20rpx;
					background-color: #8C8C8C;
					border-radius: 2rpx;
					margin: 0 10rpx;

				}

				text {
					color: #FF5C60;
				}
			}
		}
	}
</style>